import { defineStore } from "pinia";
import { getVideo } from "../../api/index";
import { FileItf } from "../../interface/index";

export const videoStore = defineStore("video", {
    state() {
        let videoDetail: FileItf = {
            id: 0,
            parentId: 0,
            path: "",
            isFile: false,
            isImg: false,
            isVideo: false,
            size: 0,
            thumbnailPath: "",
            ext: "",
            duration: 0,
            isDir: false,
            fileName: "",
            relativePath: ""
        };
        return {
            videoDetail
        };
    },
    getters: {
    },
    actions: {
        async getVideoChangeStore(id: number){
            let res = await getVideo( id )
            this.videoDetail = res.data
        }
    },
});
